import Vue from 'vue'
import DQBasicVueComponent from 'DQBasic-vue-component'
import 'DQBasic-vue-component/assets/icons'
import { parseTime } from '@/framework/utils/date'
import { checkPhone, checkSocialCode, checkEmail, checkSort, checkAccountName } from '@/framework/utils/validate'
import { resetForm } from '@/framework/utils/ruoyi'
// eslint-disable-next-line import/namespace
import { download } from '@/framework/utils/request'
import axios from 'axios'
import authTable from '@/framework/components/auth-coms/authTable/authTable.vue'
import formDesignTable from '@/framework/components/formDesign-coms/formDesignTable.vue'
import fromTable from '@/framework/views/workflow/flowManage/flowFormDesign/components/fromTable'
import dtSelectOrg from '@/framework/components/addPerson/dt-select-org-dialog.vue'
import basicData from '@/framework/components/basicData/index.vue'
import { formDsignComponents } from '@/framework/views/developer-center/application-center/application-system/applicationFormDesign/components/index'

export function customComponents() {
  Vue.prototype.resetForm = resetForm
  Vue.prototype.parseTime = parseTime // 格式化时间
  Vue.prototype.validate = { checkPhone, checkSocialCode, checkEmail, checkSort, checkAccountName }
  Vue.prototype.download = download // 导出
  Vue.prototype.$axios = axios
  Vue.use(DQBasicVueComponent)
  Vue.component('authTable', authTable)
  Vue.component('formDesignTable', formDesignTable)
  Vue.component('fromTable', fromTable)
  Vue.component('dtSelectOrg', dtSelectOrg)
  Vue.component('basicData', basicData)
  formDsignComponents() // 注册低代码-表单设计中的组件
}

